home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / misc / emu / ATUtilities.lha / ATUtilities / BASIC / PC-FILEM.BAS < prev    next >
Encoding:
BASIC Source File  |  2000-09-26  |  17.0 KB  |  804 lines

  1. $STRING 4
  2.  
  3.  
  4.  
  5. $INCLUDE "GEMDOS.INC"
  6.  
  7. olddir$=curdir$
  8. olddrive$=left$(curdir$,1)
  9.  
  10.  
  11. editor$="GSEDIT.EXE"
  12.  
  13.  
  14. dim Feld1$(15)
  15. dim Feld2$(26)
  16. dim dir.fname$(200)
  17. dim dir.ftype(200)
  18. dim dir.select(200)      : rem ALTER WERT: 1000  !!!!!!!!!!!!!!!!!!
  19. dim dir.fcmd(200)
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. if command$=GemDOS$ then
  27.  call PrepareScreen(50,"PC-Dateimanager")
  28. else
  29.  call InitScreen(50,"PC-Dateimanager")
  30. end if
  31.  
  32. call BoolGadget(5,26,15,1,"L”schen",2000)
  33. call BoolGadget(24,26,15,1,"Umbenennen",2001)
  34. call BoolGadget(42,26,15,1,"Kopieren",2002)
  35. call BoolGadget(60,26,15,1,"Editieren",2003)
  36.  
  37. call MenuGadget(6,"Datei",10000)
  38. call MenuGadget(15,"Laufwerk",10001)
  39. call MenuGadget(28,"Einstellungen",10002)
  40. call MenuGadget(45,"Markieren",10003)
  41.  
  42. call DrawNBorder(5,8,63,17,"")
  43. call BoolGadget(70,8,5,1,chr$(30),100)
  44. call BoolGadget(70,24,5,1,chr$(31),101)
  45. call BoolGadget(70,10,5,1,chr$(17),102)
  46. call BoolGadget(70,22,5,1,chr$(16),103)
  47. call BoolGadget(70,15,5,1,chr$(9),104)
  48. call BoolGadget(70,17,5,1,"\",105)
  49. for i=0 to 16
  50.  call MinGadget(13,8+i,54,1,i)
  51.  call MinGadget(6,8+i,6,1,500+i)
  52. next
  53.  
  54. Feld1$(0)="Datei(en) l”schen"
  55. Feld1$(1)="Datei(en) umbenennen"
  56. Feld1$(2)="Datei(en) kopieren"
  57. Feld1$(3)="Datei(en) editieren"
  58. Feld1$(4)="-"
  59. Feld1$(5)="Verzeichnis erstellen"
  60. Feld1$(6)="Verzeichnis l”schen"
  61. Feld1$(7)="Verzeichnis wechseln"
  62. Feld1$(8)="-"
  63. Feld1$(9)="Information"
  64. Feld1$(10)="-"
  65. Feld1$(11)="DOS-Kommandointerpreter"
  66. Feld1$(12)="-"
  67. Feld1$(13)="Zurck zu AControl"
  68.  
  69. Feld3$(0)="  Systemdateien anzeigen"
  70. Feld3$(1)="  Versteckte Dateien anzeigen"
  71. Feld3$(2)="-"
  72. Feld3$(3)="  Abfrage beim L”schen"
  73. Feld3$(4)="  Abfrage beim Kopieren"
  74. Feld3$(5)="-"
  75. Feld3$(6)="Voreinstellungen sichern"
  76.  
  77. Feld4$(0)="Alle Dateien markieren"
  78. Feld4$(1)="Alle Dateien demarkieren"
  79.  
  80. call NewWindow(10,12,60,3,0)
  81. color 15
  82. locate 14,12
  83. print "Angeschlossene Laufwerke werden getestet... Bitte warten!"
  84.  
  85. call SetDrive(olddrive$)
  86. volumes=drives
  87. x=0
  88. z$=""
  89. for i=asc("A") to volumes+asc("A")
  90.  if i>asc("B") then
  91.   reg %ax,&H36*256
  92.   reg %dx,i-asc("A")+1
  93.   call interrupt &H21
  94.  
  95.   ax&=0
  96.   def seg = varseg(ax&)
  97.   pokei varptr(ax&),reg(%ax)
  98.   if ax&=65535 then
  99.    Feld2$(x)=chr$(i)+":   0 KB"+chr$(0)
  100.   else
  101.    x&=reg(%ax)*reg(%cx)*reg(%dx)
  102.    x&=x&/1024
  103.    x$=str$(x&) : e$="KB"
  104.    if len(x$)>4 then
  105.     x&=x&/1024
  106.     x$=str$(x&)
  107.     e$="MB"
  108.    end if
  109.    x$=string$(4-len(x$)," ")+x$+" "+e$
  110.    Feld2$(x)=chr$(i)+":"+x$
  111.   end if
  112.  else
  113.   reg %ax,&H08*256
  114.   reg %dx,i-asc("A")
  115.   call interrupt &H13
  116.   select case int(reg(%bx) mod 256)
  117.    case 1
  118.     z$=" 320 KB"
  119.    case 2
  120.     z$=" 1.2 MB"
  121.    case 3
  122.     z$=" 720 KB"
  123.   end select
  124.   Feld2$(x)=chr$(i)+":"+z$
  125.  end if
  126.  x=x+1
  127. next
  128.  
  129. call CloseWindow
  130.  
  131. call CD(curdir$)
  132. call MouseOn
  133.  
  134. ende=0
  135. while ende=0
  136.  call MouseDown
  137.  if mouse.button<>0 then call MouseHandler
  138.  
  139.  select case gad.num
  140.   case 33333
  141.    ende=1
  142.   case 2000
  143.    call DelFiles
  144.   case 2001
  145.    call RenFiles
  146.   case 2002
  147.    call CopyFiles
  148.   case 2003
  149.    call ViewFiles
  150.   case 100
  151.    if dir.pos>0 then
  152.     dir.pos=dir.pos-1
  153.     call ShowFiles
  154.    else
  155.     call Audio(1000,2)
  156.    end if
  157.   case 101
  158.    if dir.pos<(dir.files)-17 then
  159.     dir.pos=dir.pos+1
  160.     call ShowFiles
  161.    else
  162.     call Audio(1000,2)
  163.    end if
  164.   case 102
  165.    if dir.pos>17 then
  166.     dir.pos=dir.pos-17
  167.     call ShowFiles
  168.    else
  169.     dir.pos=0
  170.     call ShowFiles
  171.    end if
  172.   case 103
  173.    if dir.files>16 then
  174.     if dir.pos<(dir.files-34) then
  175.      dir.pos=dir.pos+17
  176.      call ShowFiles
  177.     else
  178.      dir.pos=dir.files-17
  179.      call ShowFiles
  180.     end if
  181.    end if
  182.   case 104
  183.    if len(dir.current$)>3 then
  184.     call CD(dir.current$+"..")
  185.    end if
  186.   case 105
  187.    call CD(left$(dir.current$,1)+":\")
  188.   case 10000
  189.    call MenuHandler(6,220,Feld1$(),14)
  190.    select case menu.num
  191.     case 13
  192.      ende=1
  193.     case 11
  194.      call LoadNonApp("command",0)
  195.      call DrawNBorder(5,8,63,17,"")
  196.      call CD(left$(dir.current$,len(dir.current$)-1))
  197.     case 0
  198.      call DelFiles
  199.     case 1
  200.      call RenFiles
  201.     case 2
  202.      call CopyFiles
  203.     case 3
  204.      call ViewFiles
  205.     case 9
  206.      call InformationBox("PC-Filemanager - Version 1.0","Copyright (C) 1994 by","Thomas Dreibholz","All rights reserved.")
  207.    end select
  208.   case 10001
  209.    call MenuHandler(15,100,Feld2$(),volumes)
  210.    if menu.num<>-1 then
  211.     call CD(chr$(asc("A")+menu.num)+":\")
  212.    end if
  213.   case 10002
  214.    call MenuHandler(28,270,Feld3$(),7)
  215.    select case menu.num
  216.     case 0
  217.      call CD(dir.current$)
  218.     case 1
  219.      call CD(dir.current$)
  220.    end select
  221.   case 10003
  222.    call MenuHandler(45,220,Feld4$(),2)
  223.    select case menu.num
  224.     case 1
  225.      for i=0 to dir.files-1
  226.       dir.select(i)=0
  227.      next
  228.      call MouseOff
  229.      for i=0 to 16
  230.       typ=dir.ftype(i+dir.pos)
  231.       if typ<>16 and typ<>64 and typ<>128 then
  232.        locate i+9,14
  233.        print " ";
  234.       end if
  235.      next
  236.      call MouseOn
  237.     case 0
  238.      for i=0 to dir.files-1
  239.       typ=dir.ftype(i)
  240.       if typ<>16 and typ<>64 and typ<>128 then
  241.        dir.select(i)=1
  242.       end if
  243.      next
  244.      call MouseOff
  245.      for i=0 to 16
  246.       typ=dir.ftype(i+dir.pos)
  247.       if typ<>16 and typ<>64 and typ<>128 then
  248.        locate i+9,14
  249.        call AsciiPrint(14,chr$(5))
  250.       end if
  251.      next
  252.      call MouseOn
  253.    end select
  254.   case else
  255.    if gad.num>=500 and gad.num<517 then
  256.     if dir.fcmd(dir.pos+gad.num-500)=1 then
  257.      call RunProg(dir.fname$(dir.pos+gad.num-500))
  258.     end if
  259.    elseif gad.num>=0 and gad.num<17 then
  260.     if dir.ftype(dir.pos+gad.num)=16 then
  261.      call CD(dir.current$+dir.fname$(dir.pos+gad.num))
  262.     elseif dir.ftype(dir.pos+gad.num)=64 then
  263.     elseif dir.ftype(dir.pos+gad.num)=128 then
  264.      call CD(dir.current$+"..")
  265.     else
  266.      if dir.select(dir.pos+gad.num)=0 then
  267.       dir.select(dir.pos+gad.num)=1
  268.       z$=chr$(5)
  269.      else
  270.       dir.select(dir.pos+gad.num)=0
  271.       z$=" "
  272.      end if
  273.      locate gad.num+9,14
  274.      call MouseOff
  275.      call AsciiPrint(14,z$)
  276.      call MouseOn
  277.     end if
  278.    end if
  279.  end select
  280.  
  281.  gad.num=-1
  282. wend
  283.  
  284. call MouseOff
  285. call SetDrive(olddrive$)
  286. chdir olddir$
  287. end
  288.  
  289. sub CD(x$) shared
  290.  call NewWindow(20,12,40,5,0)
  291.  call MouseOff
  292.  color 15
  293.  locate 14,22
  294.  print "Neues Verzeichnis wird eingelesen:"
  295.  locate 15,22
  296.  print x$
  297.  locate 16,22
  298.  print "Bitte warten!"
  299.  lw$=left$(x$,1)
  300.  call SetDrive(lw$)
  301.  dos.fehler=0
  302. 710 error 0
  303. 712 dummy$=curdir$
  304. 713 chdir x$
  305. 714 dummy$=dir$("*.*",8)
  306.  if len(curdir$)>3 then dir.current$=curdir$+"\" else dir.current$=curdir$
  307.  call DrawNBorder(5,6,70,1,dir.current$+string$(66-len(dir.current$)," "))
  308.  call MouseOn
  309.  if dos.fehler>0 and (dos.fzeile>=712 or dos.fzeile<=714) then
  310.   dir.files=0
  311.   dir.pos=0
  312.   for i=0 to 36
  313.    dir.fname$(i)="   "
  314.    dir.ftype(i)=64
  315.    dir.select(i)=0
  316.   next
  317.   call CloseWindow
  318.   call ShowFiles
  319.   exit sub
  320.  end if
  321.  call LoadDir
  322. end sub
  323.  
  324. sub LoadDir shared
  325.  x=16
  326.  if ToggleMenuStatus(Feld3$(0))=1 then x=x+2
  327.  if ToggleMenuStatus(Feld3$(1))=1 then x=x+4
  328.  x$=dir$(dir.current$,x)
  329.  if len(dir.current$)>3 then
  330.   dir.files=1
  331.   dir.ftype(0)=128
  332.  else
  333.   dir.files=0
  334.  end if
  335.  while x$<>""
  336.   dir.fname$(dir.files)=x$
  337.   dos.fehler=0
  338.   dir.ftype(dir.files)=attrib(dir.current$+x$)
  339.   tt$=right$(x$,4)
  340.   if tt$=".EXE" or tt$=".COM" or tt$=".BAT" then
  341.    dir.fcmd(dir.files)=1
  342.   else
  343.    dir.fcmd(dir.files)=0
  344.   end if
  345.   if dos.fehler<>0 then
  346.    if dir.files<2 then
  347.     dir.files=0
  348.     dir.pos=0
  349.     for i=0 to 36
  350.      dir.fname$(i)="   "
  351.      dir.ftype(i)=64
  352.      dir.select(i)=0
  353.     next
  354.     call CloseWindow
  355.     call ShowFiles
  356.     exit sub
  357.    end if
  358.   end if
  359.   dir.select(dir.files)=0
  360.   error 0
  361.   x$=dir$
  362.   dir.files=dir.files+1
  363.  wend
  364.  for i=dir.files to dir.files+36
  365.   dir.fname$(i)="   "
  366.   dir.ftype(i)=64
  367.   dir.select(i)=0
  368.  next
  369.  dir.pos=0
  370.  call CloseWindow
  371.  call ShowFiles
  372. end sub
  373.  
  374. sub ShowFiles shared
  375.  call MouseOff
  376.  for i=dir.pos to dir.pos+16
  377.   locate 9+i-dir.pos,8
  378.   if dir.ftype(i)=16 then
  379.    color 14
  380.    print "       <";dir.fname$(i);">";string$(14," ")
  381.   elseif dir.ftype(i)=128 then
  382.    color 2
  383.    print "       <..>"+string$(14," ")
  384.   elseif dir.ftype(i)=64 then
  385.    color 0
  386.    print string$(24," ")
  387.   else
  388.    if dir.select(i)=1 then z$=chr$(5) else z$=" "
  389.    if dir.fcmd(i)=1 then
  390.     q$=chr$(9)+chr$(29)+chr$(9)+"   "
  391.    else
  392.     q$="      "
  393.    end if
  394.    call AsciiPrint(10,q$)
  395.    call AsciiPrint(14,z$)
  396.    color 4
  397.    print dir.fname$(i);string$(14," ")
  398.   end if
  399.  next
  400.  call MouseOn
  401. end sub
  402.  
  403. sub SetDrive(drv$) shared
  404.  reg %ax,&H0D*256
  405.  call interrupt &H21
  406.  reg %ax,&H0E*256
  407.  reg %dx,asc(drv$)-asc("A")
  408.  call interrupt &H21
  409.  drives=int(reg(%ax) mod 256)
  410. end sub
  411.  
  412. function SFCount shared
  413.  erg=0
  414.  for i=0 to dir.files-1
  415.   if dir.select(i)=1 then
  416.    erg=erg+1
  417.   end if
  418.  next
  419.  SFCount=erg
  420. end function
  421.  
  422. sub DelFiles shared
  423.  sf=SFCount
  424.  if sf>0 then
  425.   if ToggleMenuStatus(Feld3$(3))=1 then
  426.    call NewWindow(15,12,50,7,1)
  427.    call MouseOff
  428.    call CenterInWindow(13,"Datei(en) l”schen")
  429.    locate 15,18
  430.    print "Wollen Sie die Datei"
  431.    locate 17,18
  432.    print "wirklich l”schen?"
  433.    call BoolGadget(17,18,14,1,"L”schen",12000)
  434.    call BoolGadget(49,18,14,1,"šbergehen",12001)
  435.    call BoolGadget(33,18,14,1,"Abbrechen",12002)
  436.    call MouseOn
  437.    dels=0
  438.    for ii=0 to dir.files-1
  439.     if dir.select(ii)=1 then
  440.      locate 16,18
  441.      f$=dir.current$+dir.fname$(ii)
  442.      call MouseOff
  443.      print f$;string$(48-len(f$)," ")
  444.      call MouseOn
  445.      ende1=0
  446.      while ende1=0
  447.       call MouseDown
  448.       if mouse.button<>0 then
  449.        call MouseHandler
  450.        select case gad.num
  451.     case 12000
  452.      del=1
  453.      ende1=1
  454.     case 12001
  455.      del=0
  456.      ende1=1
  457.     case 12002
  458.      del=0
  459.      ii=dir.files
  460.      ende1=1
  461.     end select
  462.       end if
  463.      wend
  464.      if del=1 then
  465.       dels=dels+1
  466.       dos.fehler=0
  467.       kill f$
  468.       if dos.fehler<>0 then call Audio(2000,2)
  469.      end if
  470.     end if
  471.    next
  472.    call CloseWindow
  473.    call CD(left$(dir.current$,len(dir.current$)-1))
  474.   else
  475.    call NewWindow(15,12,50,7,1)
  476.    call MouseOff
  477.    Call CenterInWindow(13,"Dateien l”schen")
  478.    locate 15,18
  479.    print "Wollen Sie wirklich alle markierten Dateien"
  480.    locate 16,18
  481.    print "l”schen?"
  482.    call BoolGadget(17,17,14,1,"L”schen",12000)
  483.    call BoolGadget(49,17,14,1,"Abbruch",12001)
  484.    call MouseOn
  485.    ende1=0
  486.    while ende1=0
  487.     call MouseDown
  488.     if mouse.button<>0 then
  489.      call MouseHandler
  490.      select case gad.num
  491.       case 12000
  492.        del=1
  493.        ende1=1
  494.       case 12001
  495.        del=0
  496.        ende1=1
  497.      end select
  498.     end if
  499.    wend
  500.    call CloseWindow
  501.    if del=1 then
  502.     call NewWindow(15,12,50,2,0)
  503.     locate 13,18
  504.     call MouseOff
  505.     print "Datei wird gel”scht:"
  506.     call MouseOn
  507.     for ii=0 to dir.files-1
  508.      if dir.select(ii)=1 then
  509.       f$=dir.current$+dir.fname$(ii)
  510.       locate 14,18
  511.       call MouseOff
  512.       print f$;string$(48-len(f$)," ")
  513.       call MouseOn
  514.       dos.fehler=0
  515.       kill f$
  516.      if dos.fehler<>0 then call Audio(2000,2)
  517.      end if
  518.     next
  519.     call CloseWindow
  520.     call CD(left$(dir.current$,len(dir.current$)-1))
  521.    end if
  522.   end if
  523.  end if
  524. end sub
  525.  
  526. sub CopyFiles shared
  527.  sf=SFCount
  528.  if sf>0 then
  529.   call NewWindow(10,12,60,6,1)
  530.   call CenterInWindow(13,"Datei(en) kopieren")
  531.   call StrGadget(13,14,54,1,"D:\",51,10000)
  532.   call BoolGadget(13,16,20,1,"Kopieren",12000)
  533.   call BoolGadget(47,16,20,1,"Abbruch",12001)
  534.   call MouseOn
  535.   ende1=0
  536.   while ende1=0
  537.    call MouseDown
  538.    if mouse.button<>0 then
  539.     call MouseHandler
  540.     select case gad.num
  541.      case 12000
  542.       s=1
  543.       ende1=1
  544.      case 12001
  545.       s=0
  546.       ende1=1
  547.     end select
  548.    end if
  549.   wend
  550.   nn$=GetGadgetText$(10000)
  551.   call CloseWindow
  552.   if s=1 then
  553.    if nn$<>dir.current$ then
  554.     if ToggleMenuStatus(Feld3$(4))=1 then
  555.      call NewWindow(15,12,50,7,1)
  556.      call MouseOff
  557.      call CenterInWindow(13,"Datei(en) kopieren")
  558.      locate 15,18
  559.      print "Wollen Sie die Datei"
  560.      locate 17,18
  561.      print "wirklich kopieren?"
  562.      call BoolGadget(17,18,14,1,"Kopieren",12000)
  563.      call BoolGadget(49,18,14,1,"šbergehen",12001)
  564.      call BoolGadget(33,18,14,1,"Abbrechen",12002)
  565.      call MouseOn
  566.      for ii=0 to dir.files-1
  567.       if dir.select(ii)=1 then
  568.        locate 16,18
  569.        f$=dir.current$+dir.fname$(ii)
  570.        call MouseOff
  571.        print f$;string$(48-len(f$)," ")
  572.        call MouseOn
  573.        ende1=0
  574.        while ende1=0
  575.     call MouseDown
  576.     if mouse.button<>0 then
  577.      call MouseHandler
  578.      select case gad.num
  579.       case 12000
  580.        cpy=1
  581.        ende1=1
  582.       case 12001
  583.        cpy=0
  584.        ende1=1
  585.       case 12002
  586.        cpy=0
  587.        ii=dir.files
  588.        ende1=1
  589.       end select
  590.     end if
  591.        wend
  592.        if cpy=1 then
  593.     call Kopiere
  594.        end if
  595.       end if
  596.      next
  597.      call CloseWindow
  598.     else
  599.      call NewWindow(15,12,50,2,0)
  600.      locate 13,18
  601.      call MouseOff
  602.      print "Datei wird kopiert:"
  603.      call MouseOn
  604.      for ii=0 to dir.files-1
  605.       if dir.select(ii)=1 then
  606.        f$=dir.current$+dir.fname$(ii)
  607.        locate 14,18
  608.        call MouseOff
  609.        print f$;string$(48-len(f$)," ")
  610.        call MouseOn
  611.        call Kopiere
  612.       end if
  613.      next
  614.      call CloseWindow
  615.     end if
  616.    else
  617.     call NewWindow(20,12,40,4,0)
  618.     call CenterInWindow(13,"Datei(en) kopieren")
  619.     locate 15,23 : print "Das Quellverzeichnis kann nicht"
  620.     locate 16,23 : print "das Zielverzeichnis sein!"
  621.     call MouseOn
  622.     call WaitForClick
  623.     call CloseWindow
  624.    end if
  625.   end if
  626.  end if
  627. end sub
  628.  
  629. sub Kopiere shared
  630.  if right$(nn$,1)<>"\" then nn$=nn$+"\"
  631.  dos.fehler=0
  632.  open dir.fname$(ii) for binary access read as #1
  633.  if dos.fehler=0 then
  634.   open nn$+dir.fname$(ii) for binary access write as #2
  635.   ok=0
  636.   if dos.fehler=0 then
  637.    while not eof(1)
  638.     get$ #1,2048,dd$
  639.     if dos.fehler=0 then
  640.      put$ #2,dd$
  641.      if dos.fehler<>0 then
  642.       goto cpy.okay
  643.      end if
  644.     else
  645.      goto cpy.okay
  646.     end if
  647.    wend
  648.    ok=1
  649. cpy.okay:
  650.    erase dd$
  651.    close #1,#2
  652.    if ok=0 then
  653.     call Audio(2000,2)
  654.     kill nn$+dir.fname$(ii)
  655.    end if
  656.   else
  657.    call Audio(2000,2)
  658.    close #1
  659.   end if
  660.  else
  661.   call Audio(2000,2)
  662.  end if
  663. end sub
  664.  
  665. sub RunProg(n$) shared
  666.  call NewWindow(5,12,70,5,1)
  667.  call MouseOff
  668.  color 15
  669.  call CenterInWindow(13,"Programm "+dir.current$+n$+" aufrufen")
  670.  n$=n$+" "
  671.  call StrGadget(8,14,64,1,n$,61,12002)
  672.  call BoolGadget(8,16,18,1,"Aufrufen",12000)
  673.  call BoolGadget(54,16,18,1,"Abbruch",12001)
  674.  call MouseOn
  675.  ende1=0
  676.  while ende1=0
  677.   call MouseDown
  678.   if mouse.button<>0 then
  679.    call MouseHandler
  680.    select case gad.num
  681.     case 12000
  682.      s=1
  683.      ende1=1
  684.     case 12001
  685.      s=0
  686.      ende1=1
  687.    end select
  688.   end if
  689.  wend
  690.  nn$=GetGadgetText$(12002)
  691.  call CloseWindow
  692.  if s=1 then
  693.   call LoadNonApp(nn$,1)
  694.   call DrawNBorder(5,8,63,17,"")
  695.   call CD(left$(dir.current$,len(dir.current$)-1))
  696.  end if
  697. end sub
  698.  
  699. sub RenFiles shared
  700.  sf=SFCount
  701.  if sf>0 then
  702.   call NewWindow(15,12,50,6,1)
  703.   call CenterInWindow(13,"Datei(en) umbenennen")
  704.   call BoolGadget(17,16,14,1,"Umbenennen",12000)
  705.   call BoolGadget(49,16,14,1,"šbergehen",12001)
  706.   call BoolGadget(33,16,14,1,"Abbrechen",12002)
  707.   call MouseOn
  708.   for ii=0 to dir.files-1
  709.    if dir.select(ii)=1 then
  710.     color 15
  711.     locate 15,17
  712.     call MouseOff
  713.     print dir.fname$(ii);" umbenennen in";
  714.     call StrGadget(48,14,15,1,dir.fname$(ii),12,10000)
  715.     call MouseOn
  716.     ende1=0
  717.     while ende1=0
  718.      call MouseDown
  719.      if mouse.button<>0 then
  720.       call MouseHandler
  721.       select case gad.num
  722.        case 12000
  723.     s=1
  724.     ende1=1
  725.        case 12001
  726.     s=0
  727.     ende1=1
  728.        case 12002
  729.     goto ren.okay
  730.       end select
  731.      end if
  732.     wend
  733.     nn$=GetGadgetText$(10000)
  734.     call RemoveGadget(10000)
  735.     if s=1 and nn$<>dir.fname$(ii) then
  736.      color 15
  737.      locate 15,17
  738.      call MouseOff
  739.      color 15
  740.      xx$="Datei wird in "+nn$+" umbenannt..."
  741.      print xx$;string$(46-len(xx$)," ")
  742.      call MouseOn
  743.      dos.fehler=0
  744.      name dir.fname$(ii) as nn$
  745.      if dos.fehler=0 then
  746.       dir.fname$(ii)=nn$
  747.      else
  748.       call Audio(2000,2)
  749.      end if
  750.     end if
  751.    end if
  752.   next
  753. ren.okay:
  754.   call CloseWindow
  755.   call ShowFiles
  756.  end if
  757. end sub
  758.  
  759. sub ViewFiles shared
  760.  sf=SFCount
  761.  if sf>0 then
  762.   for ii=0 to dir.files-1
  763.    if dir.select(ii)=1 then
  764.     call NewWindow(15,12,50,6,1)
  765.     call CenterInWindow(13,"Datei(en) editieren")
  766.     call BoolGadget(17,16,14,1,"Editieren",12000)
  767.     call BoolGadget(49,16,14,1,"šbergehen",12001)
  768.     call BoolGadget(33,16,14,1,"Abbrechen",12002)
  769.     color 15
  770.     locate 15,18
  771.     print "Datei ";dir.fname$(ii);" mit ";editor$;" anzeigen?"
  772.     call MouseOn
  773.     ende1=0
  774.     while ende1=0
  775.      call MouseDown
  776.      if mouse.button<>0 then
  777.       call MouseHandler
  778.       select case gad.num
  779.        case 12000
  780.     s=1
  781.     ende1=1
  782.        case 12001
  783.     s=0
  784.     ende1=1
  785.        case 12002
  786.     call CloseWindow
  787.     goto view.okay
  788.       end select
  789.      end if
  790.     wend
  791.     nn$=GetGadgetText$(10000)
  792.     call CloseWindow
  793.     if s=1 then
  794.      call LoadNonApp(editor$+" "+dir.fname$(ii),0)
  795.      call DrawNBorder(5,8,63,17,"")
  796.      call ShowFiles
  797.     end if
  798.    end if
  799.   next
  800. view.okay:
  801.   call ShowFiles
  802.  end if
  803. end sub
  804.